import Vue from 'vue'
import Vuex from 'vuex'
import { UserState } from './modules/user'
import { MenuState } from './modules/menu'
import { ThemeState } from './modules/theme'

import createLogger from 'vuex/dist/logger'

Vue.use(Vuex)

export interface MyState {
    user: UserState
    menu: MenuState
    theme: ThemeState
}

const debug = process.env.NODE_ENV !== 'production'

export default new Vuex.Store<MyState>({
    plugins: debug ? [createLogger()] : []
})
